package com.wd.pub.tools.entity.uoserver;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.dom4j.tree.AbstractEntity;
import org.hibernate.annotations.DynamicInsert;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

/**
 * @Author: He Zhigang
 * @Date: 2019/5/30 17:46
 * @Description:
 */

@Data
@Accessors(chain = true)
@DynamicInsert
@Entity
@Table(name = "org")
public class Org {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @LastModifiedDate
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date gmtModified;

    @CreatedDate
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date gmtCreate;

    @Column(unique = true)
    private String flag;

    /**
     * 机构名称
     */
    @Column(unique = true)
    private String name;

    /**
     * 省份
     */
    private String province;

    /**
     * 市、区
     */
    private String city;

    /**
     * 是否停止使用0：否，1：是
     */
    @Column(name = "is_disable", columnDefinition = "bit(1) default 0")
    private Boolean disable;
}
